<%@include file="drawreport.jsp" %>
<%@page import="helper.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/clientTemplate.css">
        <title>Report</title>
    </head>
    <body>
        <center>
        <table id="tableClientTemplate">
            <tr id="headerClientTemplate" style="background-color: orange">
                <td><%@include file="adminHeader.jsp" %></td>
            </tr>
            <tr id="middleClientTemplate">
                <td>

                    <table align="center">
                        <tr>
                            <td><img src="../chart1.png"/></td>
                        </tr>
                        <tr>
                            <td>
                                <table bgcolor="pink" cellpadding="0" cellspacing="0" style="color: cadetblue" align="center" border="1">
                            <tr>
                            <th>Activity Name</th>
                            <th>Purpose</th>
                            <th>Condition</th>
                            <th>Fee</th>
                            <th>Prize</th>
                            <th>Number Of Member</th>
                            </tr>
                              <%
                                        try {
                                            Connection con = ConnectionHelper.GetConnection();
                                            String sql = "Select * from Activities";
                                            PreparedStatement p = con.prepareStatement(sql);
                                            ResultSet rs = p.executeQuery();
                                            while (rs.next()) {
                                                sql = "Select count(*) from UsersActivities where ActivityID=?";
                                                p = con.prepareStatement(sql);
                                                p.setString(1, rs.getString("ActivityID"));
                                                ResultSet rs2 = p.executeQuery();
                            %>
                            <tr>
                                    <td><input type="text" name="txttitle" style="border: chocolate;background-color: chocolate;color: blueviolet" readonly  value="<%=rs.getString("Title")%>"/></td>
                                    <td><input type="text" name="txttitle" style="border: chocolate;background-color: chocolate;color: blueviolet" readonly  value="<%=rs.getString("Purpose")%>"/></td>
                                    <td><input type="text" name="txttitle" style="border: chocolate;background-color: chocolate;color: blueviolet" readonly  value="<%=rs.getString("Condition")%>"/></td>
                                    <td><input type="text" name="txttitle" style="border: chocolate;background-color: chocolate;color: blueviolet" readonly  value="<%=rs.getString("Fee")%>"/></td>
                                    <td><input type="text" name="txttitle" style="border: chocolate;background-color: chocolate;color: blueviolet" readonly  value="<%=rs.getString("Prize")%>"/></td>
                                        <%
                                                            if (rs2.next()) {
                                        %>
                                    <td><input type="text" name="txtcount" style="border: chocolate;background-color: chocolate;color: blueviolet" readonly  value="<%=rs2.getInt(1)%>"/></td>
                                        <%
                                                            }
                                        %>
                             </tr>
                            <%}
                                        } catch (Exception e) {
                                            e.printStackTrace();
                                        }
                            %>
                        </table>
                            </td>
                        </tr>
                    </table>

                </td>
            </tr>
            <tr id="footerClientTemplate">
                <td><%@include file="adminFooter.jsp" %></td>
            </tr>
        </table>
        </center>
    </body>
</html>
